<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../vue.js"></script>
    <style>
        .red{
            color: red;
        }

        .backgound{
            background:pink;
        }

        .font{
            font-size: 20px;
            
        }

        .weight{
            font-weight: 700;
        }

        .blue{
            color: blue;
        }

        .radus{
            border-radius: 10px;
        }

        .box{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 动态class，值是一个对象 -->
        <div :class="box1">box1</div>
        <!-- 动态class 值是一个字符串 -->
        <h1 :class="isred? 'red':'blue' ">11111</h1>
        <h1 :class="fontcolor">直接使用粉色</h1>
        <!--  -->
        <div :class="arrbox">box2</div>
    </div>

    <script >
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return {
                    isred:true,
                    fontcolor:'pink',
                    box1:{
                        box:true,
                        radus:true,
                        backgound:true
                    } ,
                    arrbox:['box','blue','backgound']   
                }
            }
        })
    </script>
</body>
</html>